//统一管理用户相关的接口
import request from "@/utils/request";
// 导入接口类型
import type { LoginParamsType } from "./type";

// 枚举接口地址
enum API {
  LOGIN_URL = "/admin/acl/index/login",
  USERINFO_URL = "/admin/acl/index/info",
  LOGOUT_URL = "/admin/acl/index/logout",
}
// 登录接口
export const reqLogin = (data: LoginParamsType) =>
  request({
    url: API.LOGIN_URL,
    method: "post",
    data,
  });

// 获取用户信息
export const reqUserInfo = () =>
  request({
    url: API.USERINFO_URL,
    method: "get",
  });
